//  审核表
const sequelize = require( '../config.js')
const { DataTypes } = require('sequelize')

const studentAudit = sequelize.define('studentAudit', {
	Id: {
	  type: DataTypes.INTEGER,
	  primaryKey: true,
	  autoIncrement: true,
	},
	student_id: {
	  type: DataTypes.INTEGER,
	  allowNull: false,
	  references: {
		model: 'students',
		key: 'Id',
	  },
	  onDelete: 'CASCADE',
	  comment:'学生ID'
	},
	proposer_id:{
		type:DataTypes.INTEGER,
		references:{
			model:'userinfos',
			key:'user_id'
		},
		comment:"申请人"
	},
	proposer_state:{
		type:DataTypes.STRING,
		comment:'申请状态 1.待审核 2.已通过 3.已拒绝 4已修改'
	},
	school_id:{
		type:DataTypes.INTEGER,
		references:{
			model:'school_infos',
			key:'school_id'
		},
		comment:'所属院校'
	},
	audit_person_id:{
		type:DataTypes.INTEGER,
		references:{
			model:'userinfos',
			key:'user_id'
		},
		comment:'审核人'
	},
	audit_remark:{
		type:DataTypes.STRING,
		comment:'审核备注'
	},
	proposer_timer:{
		type:DataTypes.DATE,
		comment:'申请时间'
	}
  },{ timestamps: false});


 
  module.exports = studentAudit
  